package cn.sczhyt.modules.szhy.dao;

import cn.sczhyt.modules.szhy.entity.MeetingVoteEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 表决
 * 
 * @author luoshijie
 * @email 1169414426@qq.com
 * @date 2020-11-25 10:54:22
 */
@Mapper
public interface MeetingVoteDao extends BaseMapper<MeetingVoteEntity> {

    MeetingVoteEntity selectByVote(@Param("meetingId") String meetingId,
                                   @Param("topicsId") String topicsId,
                                   @Param("userId") String userId);

    /**
     * @param meetingId
     * @param topicsId
     * @param state
     * @return
     */
    Integer voteCount(@Param("meetingId") String meetingId,
                      @Param("topicsId") String topicsId,
                      @Param("state") Integer state);

    List<MeetingVoteEntity> findByTopicsId(String meetingId, String topicsId);
}
